﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Backend/Backend.Master"
    Inherits="System.Web.Mvc.ViewPage<IntroduceCompany.QuestionView>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    QuestionEdit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<!-- Begin one column tab content window -->
    <div class="onecolumn">
        <div class="header">
            <span>Chỉnh Sửa Câu Hỏi</span>
            <div class="switchbutton">
                <a href="<%= Url.Action("QuestionCreate", "Survey") %>" class="button">Thêm mới</a> 
                <a href="<%= Url.Action("QuestionList", "Survey", new { questionID = Model.QuestionID }) %>" class="button">Danh sách</a>
            </div>
        </div>
        <br class="clear" />
        <div class="content">
            <div class="display-label error">
                <div class="errorcontent">
                    <p><%= Html.ValidationMessage("NoticePage")%></p>
                    <p><%= Html.ValidationMessageFor(model => model.QuestionContent) %></p>
                    <p><%= Html.ValidationMessageFor(model => model.Location) %></p>
                </div>
            </div>
            <% using (Html.BeginForm("QuestionEdit", "Survey")){%>
                <%= Html.AntiForgeryToken(IntroduceCompany.Util.AntiKey.EditSalt)%>
                <%= Html.ValidationSummary(true)%>
            <div>
                <label>Ngôn ngữ:</label><br />
                <%= Html.DropDownList("LanguageID", (SelectList)ViewData["LaguageList"], new { @style = "width:300px;", onchange = "this.form.submit();" })%>
                <%= Html.HiddenFor(model => model.QuestionID) %>
            </div><br class="clear" />
            <%} %>
        
            <% using (Html.BeginForm("QuestionEditSubmit", "Survey", FormMethod.Post)){%>
            <%= Html.AntiForgeryToken(IntroduceCompany.Util.AntiKey.EditSalt)%>
            <%= Html.ValidationSummary(true) %>

            <div>
                <div class="editor_fl">
                    <label>Nội dung: </label><br />
                    <%= Html.TextBoxFor(model => model.QuestionContent, new { Maxlength = "4000", @style="width:618px;"})%>
                </div>
                <div class="editor_right">
                    <div class="editor_fr">
                        <label>Thứ tự xuất hiện:</label><br />
                        <%= Html.TextBoxFor(model => model.Location, new { @style="width:290px;"})%>
                    </div>
                </div>
            </div><br class="clear" /><br />
            <div>
                <div class="editor_left">
                    <label>
                        Ngày đăng:
                    </label>
                    <%= IntroduceCompany.Util.GeneralClass.ConvertDate_1C(Model.QuestionCreateDate.ToString())  %>
                </div>
                <div class="editor_middle width_middle">
                    <label>
                        Lần cập nhật cuối:
                    </label>
                    <%= IntroduceCompany.Util.GeneralClass.ConvertDate_1C(Model.QuestionUpdateDate.ToString())  %>
                </div>
                <div class="editor_right">
                    <label>
                        Người cập nhật cuối:
                    </label>
                    <%= Model.FullName %>
                </div>
            </div><br class="clear" /><br />
            <%= Html.HiddenFor(model => model.LanguageID) %>
            <%= Html.HiddenFor(model => model.QuestionID) %>
            <p>
                <input type="submit" value="Lưu" />
                <a href="<%= Url.Action("QuestionEdit","Survey", new { questionID = Model.QuestionID, languageID = Model.LanguageID }) %>"
                    class="buttonform">Làm Lại</a>
            </p>
            <% } %>
        </div>
    </div>
</asp:Content>
